package com.example.doctor.service;
import com.alibaba.boot.dubbo.annotation.DubboConsumer;
import com.example.pojo.FreeQuestion;
import com.example.pojo.GdComment;
import com.example.service.RpcCommentService;
import com.example.vo.AskQusetionVo;
import com.example.vo.DeptInfoVo;
import org.springframework.stereotype.Component;

import java.util.*;

/**
 * Created by LENOVO on 2018/9/26.
 */
@Component
public class CommentServiceImpl implements CommentService {

    @DubboConsumer
    private RpcCommentService rpcCommentService;
    @Override
    public List<GdComment> getCommentList(String doctorId) throws Exception {
        return rpcCommentService.getCommentList(doctorId);
    }

    @Override
    public int saveQuestion(AskQusetionVo askQusetionVo) {
        FreeQuestion freeQuestion=new FreeQuestion();
        freeQuestion.setUserid(askQusetionVo.getUserid());
        freeQuestion.setContent(askQusetionVo.getContent());
        freeQuestion.setImageurl(askQusetionVo.getImageUrl());
        freeQuestion.setCreationdate(new Date());
        return rpcCommentService.saveQuestion(freeQuestion);
    }
}
